# gnu as汇编示例 使用c库函数
.section .data
output:
    .asciz "The CPU Vender ID is '%s'\n"

.section .bss # 不占用目标文件空间，初始为0
.lcomm buffer, 12

.section .text
.global _start
_start:
    movl $0, %eax
    cpuid
    movl $buffer, %edi
    movl %ebx, (%edi)
    movl %edx, 4(%edi)
    movl %ecx, 8(%edi)
    mov $output, %rdi
    mov $buffer, %rsi
    call printf
    mov $0, %rdi
    call exit
